package net.oschina.archx.spring.service;

import net.oschina.archx.spring.dao.UserDao;
import net.oschina.archx.spring.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by Archx on 2015/6/22 0022.
 */
@Service
public class UserService {

    @Autowired
    private UserDao ud;

    public long insertLocal(User user) {
        return ud.insert(user);
    }

    public long insertRemote(User user) {
        return ud.insert(user);
    }

    public void trans(User user) {
        long id = ud.insert(user);
        System.out.println("insert id is " + id);

        // exception
        int i = 1/0;
        System.out.println(i);
    }

}
